Skip to content

Re-check every mask fingerprint right before the manifest replacement - #202

Merged
guijacquemet merged 2 commits into
mainfrom
claude/mask-final-check
Nov 7, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/mask-final-check

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Fixes #198

What and why

With verify_content off (the explicit opt-out; the default is on since #159), _final_content_check returned None, so _commit had no before_commit callback. The last mask fingerprint check ran in _publish before the report was written and the staged files were flushed. A mask that changed after it was published without mask_changed_during_run.

Now every run that has masks re-checks each mask fingerprint (changed_masks) in before_commit, right before the manifest replacement. A strict run does that plus its existing image and mask SHA-256 checks. A run without masks and without verify_content still has no callback. Image checks are unchanged (outside #198).

Regression test

tests/test_mask_run_binding.py::test_a_mask_rewritten_after_the_staged_checks_is_not_published, parametrized over opt-out and strict. It rewrites a mask when the publication record is written, which is after the staged-body checks and before before_commit.

  • Old code: opt-out case FAILS (written is True, the rewritten mask was published); strict case passes (it already had the callback).
  • New code: both pass.

Checks

python tools/check.py (ruff check, ruff format --check, pytest, code rules): 3937 passed, 4 skipped, 2 warnings. The 4 skips are existing platform skips (case-insensitive file system x3 variants, file-mode permissions as root). pipeline.py is 570 lines (limit 600). CHANGELOG entry added; expect conflicts with other open PRs, keep both entries.


Generated by Claude Code

A run with verify_content off had no before_commit callback, so a mask
changed after the staged-body check was published without
mask_changed_during_run. Every run with masks now re-checks each mask
fingerprint in before_commit; strict runs also keep their SHA-256 checks.

Fixes #198

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm

# Conflicts:
#	CHANGELOG.md
@guijacquemet
guijacquemet merged commit b5c6ebf into main Nov 7, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/mask-final-check branch November 7, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default runs can publish a mask that changed after its last fingerprint check

2 participants